package com.aruba.mvvmapplication.bindingAdapter

import android.widget.ImageView
import androidx.databinding.BindingAdapter
import coil.load
import com.aruba.mvvmapplication.R

/**
 * Created by aruba on 2021/9/22.
 */
@BindingAdapter("image")
fun setImage(imageView: ImageView, imageUrl: String?) {
    imageView.load(imageUrl) {
        placeholder(R.drawable.ic_launcher_foreground)//占位图
        crossfade(true)//淡入淡出
    }
}